package com.jic.interaction.clearAndSettlementSystem.controller;

import com.jic.common.base.vo.RestResult;
import com.jic.interaction.clearAndSettlementSystem.model.vo.request.CommercialTenantMsgSyncRequest;
import com.jic.interaction.clearAndSettlementSystem.model.vo.request.LiquidationResultDetailSyncRequest;
import com.jic.interaction.clearAndSettlementSystem.model.vo.request.OrderSyncRequest;
import com.jic.interaction.clearAndSettlementSystem.model.vo.request.SettlementIntervalSyncRequset;
import com.jic.interaction.clearAndSettlementSystem.service.ClearAndSettlementSystemService;
import com.jic.weamop.request.ChannelResponseApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@Slf4j
@RequestMapping("/cleanSystem")
@Api(tags = " [清结算系统]")

public class ClearAndSettlementSystemController {

    @Resource
    private ClearAndSettlementSystemService clearAndSettlementSystemService;


    @PostMapping("/listCommercialTenantMsgSync")
    @ApiOperation(value = " 商户信息同步")
    public com.jic.common.base.vo.RestResult<ChannelResponseApi> listCommercialTenantMsgSync(@RequestBody  @Valid CommercialTenantMsgSyncRequest request){
        return   clearAndSettlementSystemService.commercialTenantMsgSync(request);
    }

    @PostMapping("/listSettlementIntervalSync")
    @ApiOperation(value = " 结算配置")
    public com.jic.common.base.vo.RestResult<ChannelResponseApi> listSettlementIntervalSync(@RequestBody @Valid SettlementIntervalSyncRequset requset){
        return  clearAndSettlementSystemService.settlementIntervalSync(requset);
    }

    @PostMapping("/listOrderSync")
    @ApiOperation(value = " 订单同步")
    public com.jic.common.base.vo.RestResult<ChannelResponseApi> listOrderSync(@RequestBody OrderSyncRequest request){
        return clearAndSettlementSystemService.orderSync(request);
    }

    @PostMapping("/listLiqudationResultDetailSync")
    @ApiOperation(value = " 清结算结果")
    public RestResult<ChannelResponseApi> listLiqudationResultDetailSync(@RequestBody @Valid LiquidationResultDetailSyncRequest request){
        return clearAndSettlementSystemService.liqudationResultDetailSync(request);
    }
}
